package com.gxa.service.impl;

import com.gxa.mapper.LogMapper;
import com.gxa.pojo.Log;
import com.gxa.service.LogService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (Log)表服务实现类
 *
 * @author makejava
 * @since 2020-11-27 14:02:11
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired(required = false)
    private LogMapper logMapper;

    @Override
    public int addLog(Log log) {
        return logMapper.addLog(log);
    }

    @Override
    public int deleteLogByLogIds(Integer[] logIds) {
        int result=0;
        for (Integer logId : logIds) {
            result+= logMapper.deleteById(logId);
        }
        return result;
    }

    @Override
    public List<Log> queryLogByAdminId(Integer adminId) {
        return logMapper.queryLogByAdminId(adminId);
    }

    @Override
    public List<Log> selectLogByOperator(@Param("operator") String operator) {
        return logMapper.selectLogByOperator(operator);
    }
}